<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="https://unpkg.com/vue@next"></script>

    <title>Document</title>
</head>

<body>
    <div id="app">
        <app-nav></app-nav>
        <app-view>
          <app-sidebar></app-sidebar>
          <app-content></app-content>
        </app-view>
      </div>

    <a href="https://v3.cn.vuejs.org/guide/introduction.html#%E6%9D%A1%E4%BB%B6%E4%B8%8E%E5%BE%AA%E7%8E%AF">vue</a>

    <div id="todo-list-app">
        <ol>
            <!--
            现在我们为每个 todo-item 提供 todo 对象
            todo 对象是变量，即其内容可以是动态的。
            我们也需要为每个组件提供一个“key”，稍后再
            作详细解释。
          -->
            <todo-item v-for="item in groceryList" v-bind:todo="item" v-bind:key="item.id"></todo-item>
        </ol>
    </div>

    <script type="text/javascript">
        const TodoList = {
            data() {
                return {
                    groceryList: [
                        { id: 0, text: 'Vegetables' },
                        { id: 1, text: 'Cheese' },
                        { id: 2, text: 'Whatever else humans are supposed to eat' }
                    ]
                }
            }
        }

        const app = Vue.createApp(TodoList)

        app.component('todo-item', {
            props: ['todo'],
            template: `<li>{{ todo.text }}</li>`
        })

        app.mount('#todo-list-app')
    </script>
</body>

</html>